/**
 * @param {number[]} candidates
 * @param {number} target
 * @return {number[][]}
 */
var combinationSum2 = function(candidates, target) {
    const result=[]
     candidates.sort((a,b)=>(a-b))
      function bracktrack(start,path,sum)
      {
        if(sum===target){
            result.push([...path])
        }
        for(let i=start;i<candidates.length;i++){
            if(i>start&&candidates[i]===candidates[i-1])continue
            const num=candidates[i]
            if(num+sum>target)break
            path.push(num)
            bracktrack(i+1,path,sum+num)
             path.pop()
        }
      }
      bracktrack(0,[],0)
      return result
};